<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <link rel="stylesheet" th:href="@{/adminlte/layui/css/layui.css}"  media="all"/>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<div class="demoTable">
    通讯编号：
    <div class="layui-inline" style="width: 220px">
        <input class="layui-input"  id="TelConfigMes" autocomplete="off" style="width: 200px;height: 25px" placeholder="请输入通讯编号"/>
    </div>
    配置类型：
    <div class="layui-inline" style="width: 220px">
       <!-- <input class="layui-input"  id="confValveModelSearch" autocomplete="off" style="width: 200px;height: 25px"/>-->
        <select id="confValveModelSearch"  lay-verify=""  style="width: 200px">
            <option value="" >请选择配置类型</option>
            <option value="生产写配置" >生产写配置</option>
            <option value="检测写配置" >检测写配置</option>
            <option value="发货写配置" >发货写配置</option>
        </select>
    </div>
    起始日期：
    <div class="layui-inline" style="width: 220px">
        <input class="layui-input"  id="startDateConfigMes" autocomplete="off" style="width: 200px;height: 25px" placeholder="请选择起始日期"/>
    </div>
    截止日期：
    <div class="layui-inline" style="width: 220px">
        <input class="layui-input"  id="endDateConfigMes" autocomplete="off" style="width: 200px;height: 25px" placeholder="请选择截止日期"/>
    </div>
    <button class="layui-btn layui-btn-sm" data-type="reloadConfigMes">查询</button>
</div>
<table class="layui-table" lay-data="{url:'/messsage/queryAllConfigMes', page:true, id:'idTestConfigMes' }" lay-filter="demoConfigMes">
    <thead>
    <tr>
        <!--<th lay-data="{type:'checkbox', fixed: 'left'}"></th>-->
        <th lay-data="{field:'confPktSer', width:180}">包序号</th>
        <th lay-data="{field:'confDeviceAddr', width:150}">设备地址</th>
        <th lay-data="{field:'confValveModel', width:150}">配置类型</th>
        <th lay-data="{field:'confDeviceType', width:150}">设备类型</th>
        <th lay-data="{field:'code', width:150}">执行状态</th>
        <th lay-data="{field:'creat_date', width:180}">表端时间</th>
        <th lay-data="{field:'return_date', width:180}">更新时间</th>
        <th lay-data="{field:'confCoNum', width:150}">公司代码</th>
        <th lay-data="{field:'coName', width:150}">公司名</th>
        <th lay-data="{field:'coIp', width:150 }">IP地址</th>
        <th lay-data="{field:'coPort', width:150 }">端口号</th>
        <th lay-data="{field:'confUpTime', width:150}">上线时间</th>
        <th lay-data="{field:'confUpCyc', width:150}">上线间隔</th>
        <!--<th lay-data="{field:'operators', width:150}">运营商</th>-->
        <th lay-data="{field:'confVolType', width:150}">计量方式</th>
        <th lay-data="{field:'confPayType', width:150}">计费方式</th>
        <th lay-data="{field:'confValveType', width:150}">阀门类型</th>
        <th lay-data="{field:'confAlarmVol', width:150}">报警方数</th>
        <th lay-data="{field:'confOverFlowCoef', width:150}">过流系数</th>
        <th lay-data="{field:'confReserveVol', width:150}">预留气量</th>
        <th lay-data="{field:'confRechargeLimit', width:150}">充值上限</th>
        <th lay-data="{field:'confPulse', width:150}">脉冲当量</th>
        <th lay-data="{field:'confReserveFlag', width:150}">预留保留</th>
        <th lay-data="{field:'confPayDay', width:150}">结算日期</th>
        <th lay-data="{field:'confPayCyc', width:150}">结算周期</th>
        <th lay-data="{field:'confAllowVol', width:150}">透支气量</th>
        <th lay-data="{field:'confOpenTime', width:150}">开阀时间</th>
        <th lay-data="{field:'confCloseTime', width:150}">关阀时间</th>
        <th lay-data="{field:'confSignalSrc', width:150}">信号源</th>
       <!-- <th lay-data="{field:'status', width:150}">状态</th>-->
        <th lay-data="{field:'confPayCycNum', width:150}">计费周期时长</th>
        <th lay-data="{field:'microleakageTime', width:150}">微漏时间阀值</th>
        <th lay-data="{field:'noContactTime', width:150}">失联天数</th>
        <th lay-data="{field:'noUseGasDay', width:150}">不用气时间阀值</th>
        <th lay-data="{field:'flowmeter', width:150}">流量计厂家</th>
        <th lay-data="{field:'fourVersion', width:150}">485协议版本</th>
    </tr>
    </thead>
</table>

<script th:src="@{/adminlte/layui/layui.all.js}" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use('table', function(){
        var table = layui.table;
        //监听表格复选框选择
        table.on('checkbox(demoIn)', function(obj){
            console.log(obj)
        });
        //监听工具条
        table.on('tool(demoIn)', function(obj){
            var data = obj.data;
            if(obj.event === 'detail'){
                layer.msg('ID：'+ data.id + ' 的查看操作');
            } else if(obj.event === 'del'){
                layer.confirm('真的删除行么', function(index){
                    obj.del();
                    layer.close(index);
                });
            } else if(obj.event === 'edit'){
                /*layer.alert('编辑行：<br/>'+ JSON.stringify(data))*/

            }
        });
        //监听头工具栏事件
        table.on('toolbar(demoIn)', function(obj){
            var checkStatus = table.checkStatus(obj.config.id)
                ,data = checkStatus.data//获取选中的数据
                ,deList=[1];
            data.forEach(function (n,i) {
                deList.push(n.id)
            });
            deList.push(2);
        });
        var $ = layui.$, active = {
            reloadConfigMes:function () {
                var startDate = $("#startDateConfigMes").val();
                var conDeviceAddr = $("#TelConfigMes").val();
                var endDate = $("#endDateConfigMes").val();
                var confValveModel = $("#confValveModelSearch").val();
                table.reload('idTestConfigMes',{
                    url:'/messsage/serachConfigMes',
                    where:{conDeviceAddr:conDeviceAddr,confValveModel:confValveModel,startDate:startDate,endDate:endDate}  ,
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                })

            }
        };

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        laydate.render({
            elem: '#startDateConfigMes' //指定元素

        });
        laydate.render({
            elem: '#endDateConfigMes' //指定元素

        });
    });
    var unSelected = "#999";
    var selected = "#333";
    $(function () {
        $("select").css("color", unSelected);
        $("option").css("color", selected);
        $("select").change(function () {
            var selItem = $(this).val();
            if (selItem == $(this).find('option:first').val()) {
                $(this).css("color", unSelected);
            } else {
                $(this).css("color", selected);
            }
        });
    })
</script>

</body>
</html>